<template>
  <div class="app">
    <MyHeader background="pink" :color="'white'" :title="'tabbar'" />
    <div class="main">
      <component :is="comname"></component>
    </div>

    <MyTabBar :arr="tabList" @qa="show" />
  </div>
</template>

<script>
// 引入组件
import MyHeader from "./components/MyHeader.vue";
// 2.引入Table组件
import MyTabBar from "./components/MyTabBar.vue";
import MyGoodsList from "../views/MyGoodsList.vue";
import MyGoodsSearch from "../views/MyGoodsSearch.vue";
import MyUserInfo from "../views/MyUserInfo.vue";
export default {
  data() {
    return {
      comname: "MyGoodsList",
      tabList: [
        {
          iconText: "icon-shangpinliebiao",
          text: "商品列表",
          componentName: "MyGoodsList"
        },
        {
          iconText: "icon-sousuo",
          text: "商品搜索",
          componentName: "MyGoodsSearch"
        },
        {
          iconText: "icon-user",
          text: "我的信息",
          componentName: "MyUserInfo"
        }
      ]
    };
  },
  components: {
    MyHeader,
    MyTabBar,
    MyGoodsList,
    MyGoodsSearch,
    MyUserInfo
  },
  name: "",
  methods: {
    show(val) {
      // console.log(val);
      this.comname = val;
    }
  }
};
</script>

<style scoped>
.main {
  padding-top: 45px;
  padding-bottom: 51px;
}
</style>
